<template>
    <!--   成品   ！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！  -->
    <div id="produce">
        <div style="width: 100%;height: 85px;background-color: #FAFAFA;padding-top: 1%;">
            <el-col :xs="2" :sm="2" :md="2" :lg="2" style="margin: 0 0 0 2%">
                <el-input v-model="MaterielNum" placeholder="物料代号" ></el-input>
            </el-col>
            <el-col :xs="2" :sm="2" :md="2" :lg="2" style="margin:  0 2%;">
                <el-input v-model="MaterielName" placeholder="物料名称"></el-input>
            </el-col>
            <el-col :xs="2" :sm="2" :md="2" :lg="2" style="">
                <el-input v-model="Specifications" placeholder="规格型号" ></el-input>
            </el-col>
            <el-col :xs="2" :sm="2" :md="2" :lg="2" style="margin:  0 2%;">
                <el-input v-model="SpecExplain" placeholder="规格说明" ></el-input>
            </el-col>
            <el-col :xs="8" :sm="8" :md="6" :lg="4" style="text-align: left">
                <el-button type="primary" @click="selectTable">查询</el-button>
                <el-button type="success" @click="add">新增</el-button>
            </el-col>
        </div>
        <!-- 物料表格 -->
        <el-table max-height="600" class="table_produce" stripe border ref="multipleTable" :data="tableData" tooltip-effect="dark"
                   style="width: 88%;text-align: center !important;">
            <el-table-column prop="index" sortable width="60"></el-table-column>
            <el-table-column prop="MaterielCode" sortable label="序号" v-if="false"></el-table-column>
            <el-table-column prop="MaterielNum" sortable label="物料代号"></el-table-column>
            <el-table-column prop="MaterielName" sortable label="物料名称"></el-table-column>
            <el-table-column prop="Specifications" sortable show-overflow-tooltip label="规格型号" show-overflow-tooltip></el-table-column>
            <el-table-column prop="SpecExplain" label="规格说明" show-overflow-tooltip show-overflow-tooltip></el-table-column>
            <el-table-column prop="Category" sortable  label="物料状态"></el-table-column>
            <el-table-column prop="BOM" label="BOM" >
                <template scope="scope">
                    <el-button size="small" type="primary" @click="handleBOM(scope.$index, scope.row)">BOM</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="Produce" label="工序" >
                <template scope="scope">
                    <el-button size="small" type="warning" @click="handleProduce(scope.$index, scope.row)">工序</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="CustomerCode" sortable label="客户代号" v-if="false"></el-table-column>
            <el-table-column prop="CustomerName" sortable label="客户名称"></el-table-column>
            <el-table-column prop="CustomerFigureNum" sortable label="客户图号"></el-table-column>
            <el-table-column prop="CustomerImage" sortable label="客户图纸"></el-table-column>


            <el-table-column prop="ModifyDate" sortable label="日期" ></el-table-column>
            <el-table-column prop="UserName" sortable label="操作人员" ></el-table-column>
            <!-- 修改和删除 -->
            <el-table-column fixed="right" label="操作">
                <template scope="scope">
                    <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <!-- 分页 -->
        <div class="block" style="text-align: right;padding: 4% 1% 0 0">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-size="PageCount" :page-sizes="[10, 20, 30, 40,50]" :current-page="CurrentPage"  layout="total,sizes, prev, pager, next" :total="Total"></el-pagination>
        </div>
        <!-- 新增成品 -->
        <el-dialog title="新增成品" :visible.sync="dialogFormVisible" >
            <el-form :model="form" style="width: 90%;height: 100%;margin: auto;text-align: left">
                <!--<el-form-item label="物料状态" :label-width="formLabelWidth">-->
                    <!--<el-select v-model="form.Category" clearable placeholder="请选择" style="float: left;">-->
                        <!--<el-option label="半成品" value="半成品"></el-option>-->
                        <!--<el-option label="成品" value="成品"></el-option>-->
                    <!--</el-select>-->
                <!--</el-form-item>-->
                <!-- 如果是成品  ？？客户信息  -->
                <el-form-item label="客户名称" :label-width="formLabelWidth">
                    <el-input v-model="form.CustomerName" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="客户图号" :label-width="formLabelWidth">
                    <el-input v-model="form.CustomerFigureNum"  auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="客户图纸" :label-width="formLabelWidth">
                    <el-button>上传客户图纸</el-button>
                </el-form-item>

                <el-form-item label="物料代号" :label-width="formLabelWidth">
                    <el-input v-model="form.MaterielNum" auto-complete="off" style="width: 80%"></el-input>                </el-form-item>
                <el-form-item label="物料名称" :label-width="formLabelWidth">
                    <el-input v-model="form.MaterielName" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="规格型号" :label-width="formLabelWidth">
                    <el-input v-model="form.Specifications"  auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="规格说明" :label-width="formLabelWidth">
                    <el-input v-model="form.SpecExplain" type="textarea" :autosize="{ minRows: 0, maxRows: 8}"  auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="物料图号" :label-width="formLabelWidth">
                    <el-input style="width: 80%"  v-model="form.FigureNumber" auto-complete="off"></el-input>
                </el-form-item>
                <el-form-item label="物料图纸" :label-width="formLabelWidth">
                    <el-button>上传物料图纸</el-button>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="addForm">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 编辑成品 -->
        <el-dialog title="修改成品" :visible.sync="EditFormVisible">
            <el-form :model="formEdit" style="text-align: left">
                <el-form-item label="物料代号" :label-width="formLabelWidthEdit">
                    <el-input v-model="formEdit.MaterielNum" :disabled="true" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="物料名称" :label-width="formLabelWidthEdit">
                    <el-input v-model="formEdit.MaterielName" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="规格型号" :label-width="formLabelWidthEdit">
                    <el-input type="textarea" :autosize="{ minRows: 0, maxRows: 8}" v-model="formEdit.Specifications" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="规格说明" :label-width="formLabelWidthEdit">
                    <el-input type="textarea" :autosize="{ minRows: 0, maxRows: 8}" v-model="formEdit.SpecExplain" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="客户名称" :label-width="formLabelWidthEdit">
                    <el-input v-model="formEdit.CustomerName" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="客户图号" :label-width="formLabelWidthEdit">
                    <el-input v-model="formEdit.CustomerFigureNum" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="客户图纸" :label-width="formLabelWidthEdit">
                    客户图纸
                </el-form-item>


                <el-form-item label="图号" :label-width="formLabelWidthEdit">
                    <el-input v-model="formEdit.FigureNumber" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
                <el-form-item label="图片" :label-width="formLabelWidthEdit">
                    <el-input v-model="formEdit.ImagePath" style="width: 50%"></el-input>
                </el-form-item>
                <el-button>上传图片</el-button>

            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="EditFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="EditForm">提 交</el-button>
            </div>
        </el-dialog>
        <!-- 删除工站 -->
        <el-dialog title="删除物料" :visible.sync="DeleteFormVisible">
            <el-form :model="formDelete">
                <el-form-item style="font-size: 18px;">
                    <!--  怎么把工站代码显示出来 -->
                    确定删除此物料吗？
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="DeleteFormVisible = false">取 消</el-button>
                <el-button type="danger" @click="DeleteForm" >确定</el-button>
            </div>
        </el-dialog>
        <!-- BOM 表格 -->
        <el-dialog title="BOM" :visible.sync="BOMFormVisible">
            <div style="width: 100%;height: 40px;display: flex">
                <div style="flex: 8;text-align: left;font-size: 15px">物料代号：{{Num}}</div>
                <div style="flex: 3;">
                    <el-button type="success" size="small" @click="addBOMClick">新增BOM</el-button>
                    <el-button type="primary" size="small" @click="useBOMClick">引用BOM</el-button>
                </div>
            </div>
            <!--  BOM 请求物料  表格  》》》》》》》》》》   -->
            <div>
                    <el-form :model="formBOM">
                        <el-table max-height="600" class="table_BOM" stripe border ref="multipleTableBOM" :data="BOMtableData" tooltip-effect="dark"
                                   style="width: 100%;text-align: center !important;">
                            <el-table-column prop="RowNumber" sortable label="序号"></el-table-column>
                            <!-- BOM -->
                            <el-table-column prop="ChildMaterielCode" sortable label="物料代号" v-if="false"></el-table-column>
                            <el-table-column prop="ChildMaterielNum" sortable label="物料代号"></el-table-column>
                            <el-table-column prop="ChildMaterielName" sortable label="物料名称"></el-table-column>
                            <el-table-column prop="Number" sortable label="用量"></el-table-column>
                            <!-- 还不加单位  需要在物料表里加 -->
                            <el-table-column prop="ChildUnit" sortable label="单位"></el-table-column>
                            <!-- 修改和删除 -->
                            <el-table-column label="操作">
                                <template scope="scope">
                                    <el-button
                                            size="small"
                                            @click="handleBOMEdit(scope.$index, scope.row)">编辑</el-button>
                                    <el-button
                                            size="small"
                                            type="danger"
                                            @click="handleBOMDelete(scope.$index, scope.row)">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-form>
                </div>
            <div style="height:15px"></div>
            <div style="background-color: #d3cc81;height:320px">图片</div>
            <div slot="footer">
                <el-button @click="BOMFormVisible = false">取 消</el-button>
                <el-button type="danger" @click="BOMForm" >确定</el-button>
            </div>
        </el-dialog>
        <!-- 新增BOM -->
        <el-dialog title="新增BOM" :visible.sync="AddBOMDialogFormVisible" >
            <el-form :model="AddBOMForm" style="width: 90%;height: 100%;margin: auto;text-align: left">
                <el-form-item label="物料名称" :label-width="AddBOMFormLabelWidth">
                <el-select v-model="AddBOMForm.ChildMateriel" clearable placeholder="请选择">
                    <el-option v-for="item in AddBOMOptions" :key="item.MaterielCode" :label="item.MaterielName" :value="item.MaterielCode"></el-option>
                </el-select>
            </el-form-item>
                <el-form-item label="物料用量" :label-width="AddBOMFormLabelWidth">
                    <el-input style="width: 30%"  v-model="AddBOMForm.Number" auto-complete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="AddBOMDialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="addBOM">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 引用 BOM -->
        <el-dialog title="引用BOM" :visible.sync="UseBOMDialogFormVisible" >
            <el-form :model="UseBOMForm" style="width: 90%;height: 100%;margin: auto;text-align: left">
                <el-form-item label="物料名称" :label-width="AddBOMFormLabelWidth">
                    <el-select v-model="UseBOMForm.ChildMateriel" clearable placeholder="请选择">
                        <el-option v-for="item in UseBOMOptions" :key="item.MaterielCode" :label="item.MaterielName" :value="item.MaterielCode"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="物料用量" :label-width="AddBOMFormLabelWidth">
                    <el-input style="width: 30%"  v-model="UseBOMForm.Number" auto-complete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="UseBOMDialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="useBOM">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 编辑 修改  BOM -->
        <el-dialog title="修改BOM" :visible.sync="EditBOMFormVisible">
            <el-form :model="formBOMEdit" style="text-align: left">
                <el-form-item  label="物料名称"  :label-width="formBOMLabelWidthEdit">
                    <el-input v-model="formBOMEdit.ChildMaterielName" :disabled="true" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
                <el-form-item label="物料用量" :label-width="formBOMLabelWidthEdit">
                    <el-input v-model="formBOMEdit.Number" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="EditBOMFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="editBomForm">提 交</el-button>
            </div>
        </el-dialog>
        <!-- 删除 BOM -->
        <el-dialog title="删除BOM" :visible.sync="DeleteBOMFormVisible">
            <el-form :model="formBOMDelete">
                <el-form-item style="font-size: 18px;">
                    确定删除此BOM吗？
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="DeleteBOMFormVisible = false">取 消</el-button>
                <el-button type="danger" @click="DeleteBOMForm">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 工序 表格  -->
        <el-dialog title="工序" :visible.sync="ProduceDialogFormVisible" >
            <el-form :model="ProcessForm" style="width: 95%;height: 100%;margin: auto;text-align: left;font-size: 15px;">
                <!-- 点击工序的时候  从点击的那 一行  带出来的 值  应该不可以修改 -->
                <!--<div style="display: flex;height: 40px;">-->
                    <!--<div style="flex: 1;">-->
                        <!--<span>物料状态：</span>-->
                        <!--<span>{{_Category}}</span>-->
                    <!--</div>-->
                    <!--<div style="flex: 1;">-->
                        <!--<span>物料代号：</span>-->
                        <!--<span>{{_MaterielNum}}</span>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div style="display: flex;height: 40px;">-->
                    <!--<div style="flex: 1;">-->
                        <!--<span>物料名称：</span>-->
                        <!--<span>{{_MaterielName}}</span>-->
                    <!--</div>-->
                    <!--<div style="flex: 1;">-->
                        <!--<span>规格型号：</span>-->
                        <!--<span>{{_SpecExplain}}</span>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div style="height: 50px;">-->
                    <!--<span>规格说明：</span>-->
                    <!--<span>{{_Specifications}}</span>-->
                <!--</div>-->
                <el-form-item>
                    <el-button type="warning" @click="addProcessClick">新建工序</el-button>
                    <el-button type="success" @click="UseProcessClick">引用工序</el-button>
                </el-form-item>
            <!--  工序的表格  ！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！  -->
                <el-table max-height="600" class="table_BOM" stripe border ref="multipleTableStation" :data="ProcessTableData" tooltip-effect="dark"
                          style="width: 100%;text-align: center !important;">
                    <!--<el-table-column prop="index" sortable label="序号"></el-table-column>-->
                    <!--  编码是  该物料代号加 01、 02 ...  -->
                    <el-table-column prop="MaterielNumCode" sortable label="工序编号"></el-table-column>
                    <el-table-column prop="ProcedureNum" sortable label="工序代码" v-if="false"></el-table-column>
                    <el-table-column prop="ProcedureName" sortable label="工序名称"></el-table-column>
                    <el-table-column prop="WorkStationNum" sortable label="工站代号"></el-table-column>
                    <el-table-column prop="WorkStationName" sortable label="工站名称"></el-table-column>
                    <el-table-column prop="WorkContent" sortable label="工站内容"></el-table-column>
                    <el-table-column prop="WorkStationImage" sortable label="作业图片"></el-table-column>
                    <!--<el-table-column prop="" sortable label="作业图示"></el-table-column>-->
                    <el-table-column prop="ReOrder" sortable label="排序"></el-table-column>
                    <!-- 修改和删除 -->
                    <el-table-column label="操作">
                        <template scope="scope">
                            <el-button
                                    size="small"
                                    @click="handleProcessEdit(scope.$index, scope.row)">编辑</el-button>
                            <el-button
                                    size="small"
                                    type="danger"
                                    @click="handleProcessDelete(scope.$index, scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <!-- 图纸 -->
                <div style="height: 20px;"></div>
                <div style="height:350px;background-color: antiquewhite;text-align: center">
                    图纸
                </div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="ProduceDialogFormVisible = false">取 消</el-button>
                <el-button type="primary">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 新增工序 -->
        <el-dialog title="新增工序" :visible.sync="AddProcessDialogFormVisible" >
            <el-form :model="AddProcessForm" style="width: 90%;height: 100%;margin: auto;text-align: left">
                <!--  手动输入的值  默认第一条就是主工序 -->
                <el-form-item label="工序名称" :label-width="AddProcessFormLabelWidth" >
                    <el-input v-model="AddProcessForm.ProcedureName" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <!--<el-form-item label="选择工站" :label-width="AddProcessFormLabelWidth">-->
                    <!-- table 》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》 -->
                    <el-table max-height="600" class="table_BOM" stripe border ref="TableStation" :data="StationTableData" tooltip-effect="dark"
                              style="width: 100%;text-align: center !important;" @selection-change="handleSelectionChange">
                        <el-table-column type="selection"></el-table-column>
                        <el-table-column prop="index" sortable label="序号" width=""></el-table-column>
                        <el-table-column prop="WorkStationNum" sortable label="工站代号"></el-table-column>
                        <el-table-column prop="WorkStationName" sortable label="工站名称"></el-table-column>
                        <el-table-column prop="WorkContent" sortable label="工站内容"></el-table-column>
                    </el-table>
                <!--</el-form-item>-->
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="AddProcessDialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="addProcess">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 引用工序 -->
        <el-dialog title="引用工序" :visible.sync="UseProcessDialogFormVisible" >
            <el-form :model="UseProcessForm" style="width: 90%;height: 100%;margin: auto;text-align: left">
                <!--  手动输入的值  默认第一条就是主工序 -->
                <el-form-item label="工序名称" :label-width="AddProcessFormLabelWidth" >
                    <el-input v-model="UseProcessForm.ProcedureName" auto-complete="off" style="width: 80%"></el-input>
                </el-form-item>
                <el-form-item label="半成品料号">
                    <el-select v-model="valueMateriel" clearable placeholder="请选择">
                        <el-option v-for="item in GetAllMater" :key="item.MaterielCode" :label="item.MaterielName" :value="item.MaterielCode"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="UseProcessDialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="UseProcess">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 编辑  工序  -->
        <el-dialog title="修改工序" :visible.sync="EditProcessFormVisible">
            <el-form :model="formProcessEdit" style="text-align: left">
                <el-form-item  label="工序名称"  :label-width="formProcessLabelWidthEdit">
                    <el-input v-model="formProcessEdit.ProcedureNum" :disabled="true" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
                <el-form-item label="工站名称" :label-width="formProcessLabelWidthEdit">
                    <el-input v-model="formProcessEdit.WorkStationNum" :disabled="true" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
                <el-form-item label="工站内容" :label-width="formProcessLabelWidthEdit">
                    <el-input v-model="formProcessEdit.WorkContent" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
                <el-form-item label="工站序号" :label-width="formProcessLabelWidthEdit">
                    <el-input v-model="formProcessEdit.ReOrder" auto-complete="off" style="width: 50%"></el-input>
                </el-form-item>
                <el-form-item label="上传图片" :label-width="formProcessLabelWidthEdit">
                    <span v-model="formProcessEdit.WorkStationImage"></span>
                    <el-button>上传</el-button>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="EditProcessFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="editProcessForm">提 交</el-button>
            </div>
        </el-dialog>
        <!-- 删除工序 -->
        <el-dialog title="删除工序" :visible.sync="DeleteProcessFormVisible">
            <el-form :model="formProcessDelete">
                <el-form-item style="font-size: 18px;">
                    删除工序，该工序下的工站也会被删除，确定删除吗？
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="DeleteProcessFormVisible = false">取 消</el-button>
                <el-button type="danger" @click="DeleteProcessForm">确 定</el-button>
            </div>
        </el-dialog>
    </div>

</template>

<script type="text/javascript">
    export default{
        data(){
            return {
                value:'',
                _Category:'',        //  类别
                _MaterielNum:0,     //  物料代号
                _MaterielName:'',    //  物料名称
                _SpecExplain:'',     //  规格型号
                _Specifications:'',   //  规格说明
                tableData:[],     //  表格
                BOMtableData:[],   //  BOM表格
//              显示表格  查询的时候   MaterielCode:0,    //  物料唯一标示
                MaterielNum:'',     //  物料代号
                MaterielName:'',     //  物料名称
                Specifications:'',    //  规格型号
                SpecExplain:'',   //  规格说明
//                Category:'',    //  类别
//                分页
                PageCount:10 ,    // 每页几条   page-size
                CurrentPage:1,   // 当前是第几页
                Total:0 ,        // 总数
                //   新增成品     将 form表单改成自己的参数
                dialogFormVisible: false,
                form: {
                    MaterielNum: '',    //  物料号
                    MaterielName:'',    //  物料名
                    Specifications: '',   //  规格型号
                    SpecExplain: '',   //  规格说明
                    CustomerCode:0,    //  客户代号
                    CustomerName: '',   //  客户名称
                    CustomerFigureNum: '',   //  客户图号
                    CustomerImage: '',   //  客户图纸
                    Category: '',    //  状态
                    FigureNumber: ''  ,  //  图号
                    ImagePath:''      //  图片
                },
                formLabelWidth: '100',
                //  编辑物料
                EditFormVisible: false,
                formEdit:{},
                formLabelWidthEdit:'100',
                //  一点击 编辑 或新增  就获取所有客户的下拉框 ???????????????????????????????????????????????????
                CustomerData:[],
                //  删除物料
                DeleteFormVisible: false,
                formDelete:{},
                formLabelWidthDelete:'100',
                //  BOM表格
                BOMFormVisible:false ,
                formBOM:{},
                formLabelWidthBOM:'100',
                //  显示出来的 物料号
                Num:this.Num ,   //  现在点击的是哪个物料的  BOM 物料号显示到 BOM 页面   现在不需要了
                //  新增BOM
                AddBOMDialogFormVisible: false,
                AddBOMForm : {
                    "MaterielCode":'',
                    "ChildMateriel":'',
                    "Number":0,
                    "OperationUser":1    //  操作者工号
                },
                AddBOMFormLabelWidth: '100',
                AddBOMOptions:[],   //  新增BOM 下拉框选择  原料、辅料
                //  引用 BOM
                UseBOMDialogFormVisible: false,
                UseBOMForm : {
                    "MaterielCode":'',
                    "ChildMateriel":'',
                    "Number":0,
                    "OperationUser":1    //  操作者工号
                },
                UseBOMFormLabelWidth: '100',
                UseBOMOptions:[],   //  引用BOM 下拉框选择 半成品、成品
                //  编辑BOM
                EditBOMFormVisible: false,
                formBOMEdit:{},
                formBOMLabelWidthEdit:'100',
                //  删除BOM
                DeleteBOMFormVisible: false,
                formBOMDelete:{},
                formBOMLabelWidthDelete:'100',
                //   一点击工序按钮    工序
                ProduceDialogFormVisible: false,
                ProcessForm:{},
                ProduceFormLabelWidth:'100',
                //  工序的表格
                ProcessTableData:[],
                //  新增  工序
                AddProcessDialogFormVisible: false,
                AddProcessForm : {
                    "MaterielCode":0,
                    "MaterielNum":'',
                    "ProcedureName":'',   //  工序名称
                    "WorkStationNum":'',   //  工站代号
                    "OperationUser":1,
                    "UnitPrice":0 ,
                },
                AddProcessFormLabelWidth: '100',
                //  一点击 新增工序  就获取 工站的 表格 》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
                StationTableData:[],   //  新增工序按钮  的 工站表格
                multipleSelection:[],  //  存放选择的工站集合  的数组
                //   引用  工序  也属于新增 工序的一种
                UseProcessDialogFormVisible: false,
                UseProcessForm : {
                    "MaterielCode":0,
                    "MaterielNum":'',
                    "ProcedureName":'',   //  工序名称
                    "PorcessMaterielCode":'',   //  物料代号
                    "OperationUser":1,
                },
                UseProcessFormLabelWidth: '100',
                //  点击选择物料状态 （半成品、成品）  获得所有下拉框
                GetAllMater:[],
                valueMateriel:'',
                //  编辑  工序
                EditProcessFormVisible: false,
                formProcessEdit:{},
                formProcessLabelWidthEdit:'100',
                //  删除  工序
                DeleteProcessFormVisible: false,
                formProcessDelete:{},
                formProcessLabelWidthDelete:'100',
                //  选中的  工站集合
                Arr:[] ,
            }
        },
        methods:{
//                分页
            handleSizeChange(val) {
                this.PageCount = val ;   //  每页几条
                this.selectTable();
            },
            handleCurrentChange(val) {
                this.CurrentPage = val ;   // 当前是第几页
                this.selectTable();     //  点击分页的时候
            },
            //   get  传给后台值  供查询使用
            selectTable(){    // 校验输入信息正确性 ，不对直接  return
                let url;      //     加的判断  如果车间是空，则是 0
                this.isLoding=true;
                this.MaterielNum = this.MaterielNum.trim();  // 1、 去空格判断
                this.MaterielName = this.MaterielName.trim();
                this.Specifications = this.Specifications.trim();    //  规格型号
                this.SpecExplain = this.SpecExplain.trim();     //  规格说明
                url = "http://192.168.3.238:8088/MaterielManager/GetMaterielPage?MaterielNum=" + this.MaterielNum + "&MaterielName=" + this.MaterielName +
                    "&Specifications=" + this.Specifications +"&SpecExplain=" + this.SpecExplain +"&Category=成品" +"&PageCount="+this.PageCount+"&CurrentPage="+ this.CurrentPage+"&MaterielType=2";
                this.$http.get(url,).then(response => {
                    // success callback   需要一个alert告诉你查询到了
                    this.tableData=[];
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        this.Total = response.data.Total;
                        for(let i=0;i<response.data.ObjList.length;i++){
                            this.tableData.push(response.data.ObjList[i]);
                            response.data.ObjList[i].index=i+1;
                        }
                        console.log("表格添加成功")
                        console.log(response.data)
                    }
                }, response => {
                    console.log(" 表格添加失败")
                    console.log(response)
                })
            },
            //  新增成品
            add() {
                this.dialogFormVisible = true;
            },
            addForm(){
                //   post
//                let JobNumber = 1 ;
                let addUrl = "http://192.168.3.238:8088/MaterielManager/AddMateriel";
                let addForm = {
                    "MaterielNum":this.form.MaterielNum,
                    "MaterielName":this.form.MaterielName,
                    "Specifications":this.form.Specifications,  // 规格说明
                    "SpecExplain":this.form.SpecExplain,    //  规格说明
                    "CustomerCode": this.form.CustomerCode,   //  客户名称
                    "CustomerName": this.form.CustomerName,   //  客户名称
                    "CustomerFigureNum": this.form.CustomerFigureNum,   //  客户图号
                    "CustomerImage": this.form.CustomerImage,   //  客户图纸
                    "Category":'成品',    //  物料状态
                    "FigureNumber":this.form.FigureNumber,   //  物料图号
                    "ImagePath":this.form.ImagePath,     //  物料图纸
                    "OperationUser":1
                };
                console.log("新增成品")
                let that = this ;
                if(this.form.MaterielNum.length === 0 || this.form.MaterielName.length === 0){
                    alert("物料号和物料名称均不能为空");
                    return 0;
                }
                else{
                    this.$http.post(addUrl, addForm, {
                        headers: {
                            'Content-Type': 'application/x-www-form-urlencoded'
                        }
                    })
                        .then(function (response) {
                            console.log("成品新增成功");
                            console.log(response);
                            that.dialogFormVisible = false ;
                            that.selectTable();
                        })
                        .catch(function (error) {
                            console.log("错误");
                            console.log(error);
                        });
                }
            },
            //   表格的操作，物料信息修改     post
            handleEdit(index, row) {
                this.EditFormVisible = true;
                this.formEdit = row ;
            },
            EditForm() {    //   post
                let EditUrl = "http://192.168.3.238:8088/MaterielManager/UpdateMateriel";
                let EditForm = {
                    "MaterielCode":this.formEdit.MaterielCode,
                    "MaterielNum":this.formEdit.MaterielNum,
                    "CustomerCode": 1 ,    //  客户代号
                    "CustomerName": this.formEdit.CustomerName,   //  客户名称
                    "CustomerFigureNum": this.formEdit.CustomerFigureNum ,   //  客户图号
                    "CustomerImage": this.formEdit.CustomerImage ,   //  客户图纸
                    "MaterielName":this.formEdit.MaterielName,
                    "Specifications":this.formEdit.Specifications,
                    "SpecExplain":this.formEdit.SpecExplain,
                    "Category":'成品',
                    "FigureNumber":this.formEdit.FigureNumber,
                    "ImagePath":this.formEdit.ImagePath,
                    "OperationUser":1,
                };
                console.log("成品的？？？？")
                console.log(EditForm)
                let that = this ;
                this.$http.post(EditUrl, EditForm, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                    .then(function (response) {
                        that.EditFormVisible = false;
                        that.selectTable();
                        console.log("修改成功");
                        console.log(response);
//                        需要提示
                    })
                    .catch(function (error) {
                        console.log("错误");
                        console.log(error);
                    });
            },
            //  一点击新增   或者   编辑   的时候就获取用户下拉框  ？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？
            GetCustomer(){    // 校验输入信息正确性 ，不对直接  return
                let url = "http://192.168.3.238:8088/MaterielManager/GetMaterielPage";
                this.$http.get(url,).then(response => {
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        for(let i=0;i<response.data.ObjList.length;i++){
                            this.CustomerData.push(response.data.ObjList[i]);
                        }
                        console.log("表格添加成功")
                        console.log(response.data)
                    }
                }, response => {
                    console.log(" 表格添加失败")
                    console.log(response)
                })
            },
            //   物料信息删除            post     200 但是没有删除
            handleDelete(index, row) {
                this.DeleteFormVisible = true ;
                this.formDelete = row ;
            },
            DeleteForm(){
                let DeleteUrl = "http://192.168.3.238:8088/MaterielManager/DeleteMateriel";
                let deleteItem = {   //  跟后端约定好的JSON格式
                    MaterielCode:this.formDelete.MaterielCode
                };
                let that = this;  //   that管用吗   管用的，想自动刷新就在执行成功的方法里重新  searchTable 就行了
                console.log(deleteItem);
                this.$http.post(DeleteUrl, deleteItem, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                    .then(function (response) {
                        console.log("删除成功")
                        console.log(response);
                        that.DeleteFormVisible = false;     //  关闭窗口
                        that.selectTable();
//                        需要提示
                    })
                    .catch(function (error) {
                        console.log("错误");
                        console.log(error);
                    });

            },
            //   点击 BOM 按钮   this.formBOM.MaterielCode
            handleBOM(index, row) {
                this.formBOM.MaterielCode = row.MaterielCode ;
                this.Num = row.MaterielNum ;
                this.selectBOMTable();
                this.BOMFormVisible = true ;
                console.log("我现在点击了BOM按钮");
                console.log(this.formBOM)
            },
            BOMForm(){
            //  点击 BOM 打开的弹框 确定之后   收起弹框
                this.BOMFormVisible = false ;
            } ,   //  好像不需要这个
            //  BOM  get  传给后台值 MaterielCode
            selectBOMTable(){    // 校验输入信息正确性 ，不对直接  return
                let url = "http://192.168.3.238:8088/BomManager/GetBomDetail?MaterielCode=" + this.formBOM.MaterielCode ;
                this.$http.get(url,).then(response => {
                    console.log("BOM表格添加成功???????");
                    console.log(response.data);
                    this.BOMtableData = [];
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        this.Total = response.data.Total;
                        for(let i=0;i<response.data.ObjList.length;i++){
                            this.BOMtableData.push(response.data.ObjList[i]);
                            response.data.ObjList[i].index=i+1;
                        }
                        console.log("BOM表格 ")
//                        console.log(response.data)
                    }
                }, response => {
                    console.log(" 表格添加失败");
                    console.log(response)
                })

            },
            //  新增  原料  BOM
            addBOMClick() {
            //    一点击新增按钮，就出现下拉框，下拉框里面是所有物料
                this.selectAddBOM();
                this.AddBOMDialogFormVisible = true;
            },
            addBOM(){
                //   post  新增  BOM
                let addBOMUrl = "http://192.168.3.238:8088/BomManager/AddBOMDetail";
                let AddBOMForm = {
                    "MaterielCode":this.formBOM.MaterielCode,
                    "ChildMateriel":this.AddBOMForm.ChildMateriel,
                    "Number":this.AddBOMForm.Number,
                    "OperationUser":this.AddBOMForm.OperationUser,    //  操作者工号
                };
                console.log("url");
                console.log(addBOMUrl);
                console.log(AddBOMForm);
                let that = this ;
                if(this.AddBOMForm.ChildMateriel.length === 0){
                    alert("BOM号和BOM名称均不能为空");
                    return 0;
                }
                else{
                    this.$http.post(addBOMUrl, AddBOMForm, {
                        headers: {
                            'Content-Type': 'application/x-www-form-urlencoded'
                        }
                    })
                        .then(function (response) {
                            console.log("添加BOM成功?????????");
                            that.AddBOMDialogFormVisible = false ;
                            that.selectBOMTable();
                        })
                        .catch(function (error) {
                            console.log("错误");
                            console.log(error);
                        });
                }
            },
            //  引用 BOM
            useBOMClick() {
                //    一点击新增按钮，就出现下拉框，下拉框里面是所有物料
                this.selectUseBOM();
                this.UseBOMDialogFormVisible = true;
            },
            useBOM(){
                //   post  引用 BOM
                let useBOMUrl = "http://192.168.3.238:8088/BomManager/AddBOM";
                let useBOMForm = {
                    "MaterielCode":this.formBOM.MaterielCode,
                    "ChildMateriel":this.UseBOMForm.ChildMateriel,
                    "Number":this.UseBOMForm.Number,
                    "OperationUser":this.UseBOMForm.OperationUser,    //  操作者工号
                };
                console.log("引用BOM的  url?????????");
                console.log(useBOMUrl);
                console.log(useBOMForm);
                let that = this ;
                if(this.UseBOMForm.ChildMateriel.length === 0){
                    console.log("请选择引用的BOM");
                    return 0;
                }
                else{
                    this.$http.post(useBOMUrl, useBOMForm, {
                        headers: {
                            'Content-Type': 'application/x-www-form-urlencoded'
                        }
                    })
                        .then(function (response) {
                            console.log("引用  BOM成功?????????");
                            that.UseBOMDialogFormVisible = false ;
                            that.selectBOMTable();
                        })
                        .catch(function (error) {
                            console.log("错误");
                            console.log(error);
                        });
                }
            },
            // 一点开新增BOM，就获取该BOM下所有的  原料、辅料  下拉框
            selectAddBOM(){
                let url;
                url = "http://192.168.3.238:8088/MaterielManager/GetMaterielByType?MaterielType=1";
                console.log("BOM下拉框");
                this.$http.get(url,).then(response => {
                    this.AddBOMOptions = [];
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        this.AddBOMOptions = response.data.ObjList ;
                    }
//                    console.log("BOM的物料下拉框");
//                    console.log(response.data.ObjList)
                }, response => {
                    console.log(" 修改的父级请求失败");
                    console.log(response)
                })
            },
            // 一点开引用BOM，就获取该BOM下所有的  半成品  成品不能被引用  下拉框
            selectUseBOM(){
                let url;
                url = "http://192.168.3.238:8088/MaterielManager/GetMaterielByType?MaterielType=3";
//                console.log("BOM下拉框");
                this.$http.get(url,).then(response => {
                    this.UseBOMOptions = [];
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        this.UseBOMOptions = response.data.ObjList ;
                    }
//                    console.log("BOM的 半成品、成品  下拉框");
//                    console.log(response.data.ObjList)
                }, response => {
                    console.log(" 修改的父级请求失败");
                    console.log(response)
                })
            },
            //   BOM 表格的操作，BOM信息修改     post
            handleBOMEdit(index, row) {
                this.EditBOMFormVisible = true;
                this.formBOMEdit = row ;
                console.log("修改的是哪个BOM");
                console.log(row);
//              console.log(row.ChildMateriel);    没有这个东西
            },
            editBomForm() {    //   post
                let EditBomUrl = "http://192.168.3.238:8088/BomManager/UpdateBom";
                let EditBomForm = {
                    "ParentMateriel":this.formBOM.MaterielCode,    //  当前操作的是  哪一个物料
                    "MaterielCode":this.formBOMEdit.MaterielCode,    //  当前操作的是  哪一个物料的BOM
                    "ChildMateriel":this.formBOMEdit.ChildMaterielCode,   // 点击的是 BOM 的哪一行  获得该行的 BOM Num
                    "Number":this.formBOMEdit.Number,
                    "OperationUser":1,    //  操作者工号
                };
                console.log("修改BOM 的  EditBomUrl >>>>>>>>>>>>  EditBomForm  ")
                console.log(EditBomUrl)
                console.log(EditBomForm)
                let that = this ;
                this.$http.post(EditBomUrl, EditBomForm, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                    .then(function (response) {
                        that.EditBOMFormVisible = false;
                        that.selectBOMTable();
                        console.log("修改成功???????????????/");
                        console.log(response);
//                        需要提示
                    })
                    .catch(function (error) {
                        console.log("错误");
                        console.log(error);
                    });
            },
            //   BOM删除            post
            handleBOMDelete(index, row) {
                this.DeleteBOMFormVisible = true ;
                this.formBOMDelete = row ;
            },
            DeleteBOMForm(){
                let DeleteBOMUrl = "http://192.168.3.238:8088/BomManager/DeleteBom";
                let deleteBOMItem = {   //  跟后端约定好的JSON格式
                    "ParentMateriel":this.formBOM.MaterielCode,
                    "MaterielCode":this.formBOMDelete.MaterielCode,
                    "ChildMateriel":this.formBOMDelete.ChildMaterielCode,
                    "OperationUser":1,    //  操作者工号
                };
                let that = this;  //   that管用吗   管用的，想自动刷新就在执行成功的方法里重新  searchTable 就行了
                console.log("删除BOM？？？？？");
                console.log(DeleteBOMUrl);
                console.log(deleteBOMItem);
                this.$http.post(DeleteBOMUrl, deleteBOMItem, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                    .then(function (response) {
                        console.log("删除成功????>>>>>>>>>>>>>>>>>>>>>>>>>>");
                        console.log(response);
                        that.DeleteBOMFormVisible = false;     //  关闭窗口
                        that.selectBOMTable();
//                        需要提示
                    })
                    .catch(function (error) {
                        console.log("错误");
                        console.log(error);
                    });

            },
            //  开始做  工序
            handleProduce(index, row) {
                this.ProcessForm = row ;
                this._Category = row.Category ;       //  类别
                this._MaterielNum = row.MaterielNum ;        //  物料代号
                this._MaterielName = row.MaterielName ;        //  物料名称
                this._SpecExplain = row.SpecExplain ;        //  规格型号
                this._Specifications = row.Specifications ;        //  规格说明
                this.ProcessForm.MaterielCode = row.MaterielCode ;
                this.ProcessForm.MaterielNum = row.MaterielNum ;
                this.selectProcessTable();    //  点击工序，出来工序表格


                this.ProduceDialogFormVisible = true ;
                console.log("我现在点击了 >>>>>>>>>>>>>>  工序   >>>>>>>>>>>>>>>>>   按钮");
//                console.log(this.ProcessForm);
            },
            selectProcessTable(){
                let url;
                this.isLoding=true;
                url = "http://192.168.3.238:8088/MaterielManager/GetMaterielProcess?MaterielCode=" + this.ProcessForm.MaterielCode ;
                this.$http.get(url,).then(response => {
                    console.log("工序表格添加成功???????");
                    console.log(response.data);
                    this.ProcessTableData = [];
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        for(let i=0;i<response.data.ObjList.length;i++){
                            this.ProcessTableData.push(response.data.ObjList[i]);
                            response.data.ObjList[i].index=i+1;
                        }
                    }
                }, response => {
                    console.log(" 表格添加失败");
                    console.log(response)
                })

            },
//   新增工序
            //  一点击  新增工序   就出现   所有 工站的  列表 》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
            selectAllStation(){    // 校验输入信息正确性 ，不对直接  return
                let url = "http://192.168.3.238:8088/WorkStationManager/GetWorkStationPage";
                this.$http.get(url,).then(response => {
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        for(let i=0;i<response.data.ObjList.length;i++){
                            this.StationTableData.push(response.data.ObjList[i]);
                            response.data.ObjList[i].index=i+1;
                        }
                        console.log("新增工序 选择工站 >>>>>>>>>>>>>>>>>>>>>  ")
                        console.log(response.data)
                    }
                }, response => {
                    console.log(" 表格添加失败");
                    console.log(response)
                })
            },
            //  展开  新增工站页面
            addProcessClick() {
                //    一点击新增按钮，就出现下拉框，下拉框里面是所有   工站
                this.selectAllStation();
                this.AddProcessDialogFormVisible = true;
            },
            //   新增工序 选择几个工站后，提交一个 ARR 传给后台
            handleSelectionChange(val) {
                this.multipleSelection = val;
                console.log(val)
                console.log("只传工站号 >>>》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》>>>>>>>>>>>>>>>>> ")
                console.log(this.multipleSelection);    //  { {WorkStationNum:'',  ... } }
            },
            //  点击新增 确定按钮
            addProcess(){
                for(let i=0;i<this.multipleSelection.length;i++){
                    this.Arr.push(this.multipleSelection[i].WorkStationNum);
                    console.log(i)
                }
                console.log("Arr  ???????????????????????????")
                console.log(this.Arr);
                //   post
                let addProcessUrl = "http://192.168.3.238:8088/MaterielManager/AddMaterielProcess";
                let AddProcessForm = {
                    "MaterielCode":this.ProcessForm.MaterielCode,   //  新增的时候    要加 物料代号
                    "MaterielNum":this.ProcessForm.MaterielNum,   //  新增的时候    要加 物料编码
                    "ProcedureName":this.AddProcessForm.ProcedureName,
                    "WorkStationNum":this.Arr,    //  复选框  选择的  工站代码 》》》》》》》》》》》》》》》》》》》
                    "OperationUser":this.AddProcessForm.OperationUser,  //  操作的用户
                };
                console.log("新增工序的 工站  url  ?????????");
                console.log(AddProcessForm)
                console.log(addProcessUrl);
                console.log(this.multipleSelection);
                let that = this ;
                if(this.AddProcessForm.ProcedureName.length === 0){
                    console.log("工序名称不能为空");
                    return 0;
                }
                else{
                    this.$http.post(addProcessUrl, AddProcessForm, {
                        headers: {
                            'Content-Type': 'application/x-www-form-urlencoded'
                        }
                    })
                        .then(function (res) {
                            that.AddProcessDialogFormVisible = false ;
                            that.Arr = [] ;
                            that.selectProcessTable();
                            console.log("添加  工序 ");
                            console.log(res)
                        })
                        .catch(function (error) {
                            console.log("错误");
                            console.log(error);
                        });
                }
            },
            //  引用  工序
            //  工序名称    成品料号   两个字段
            UseProcessClick() {
                //    一点击引用工序按钮，就出现下拉框，下拉框里面是所有   工站
                this.selectAllMater();
                this.UseProcessDialogFormVisible = true;
            },
            UseProcess(){
                //   post
                let useProcessUrl = "http://192.168.3.238:8088/MaterielManager/AddMaterielProcess";
                let useProcessForm = {
                    "MaterielCode":this.ProcessForm.MaterielCode,   //  新增的时候    要加 物料代号
                    "MaterielNum":this.ProcessForm.MaterielNum,   //  新增的时候    要加 物料编码
                    "ProcedureName":this.UseProcessForm.ProcedureName,
                    "PorcessMaterielCode":this.valueMateriel,    //  下拉框选择的  工站代码
                    "OperationUser":this.UseProcessForm.OperationUser,  //  操作的用户
                };
                console.log("引用工序的  url  >>>>>>>>>>>>>>>>>>>>>>  ");
                console.log(useProcessUrl)
                console.log(useProcessForm);
                let that = this ;
                if(this.UseProcessForm.ProcedureName.length === 0){
                    console.log("工序名称不能为空");
                }
                else{
                    this.$http.post(useProcessUrl, useProcessForm, {
                        headers: {
                            'Content-Type': 'application/x-www-form-urlencoded'
                        }
                    })
                        .then(function (res) {
                            that.UseProcessDialogFormVisible = false ;
                            that.selectProcessTable();
                            console.log("引用  工序  成功?????????");
                            console.log(res)
                        })
                        .catch(function (error) {
                            console.log("错误");
                            console.log(error);
                        });
                }
            },
            // 一点击 引用工序 就 获取所有的  物料号
            selectAllMater(){    // 校验输入信息正确性 ，不对直接  return
                let url = "http://192.168.3.238:8088/MaterielManager/GetMaterielByType?MaterielType=3";
                this.$http.get(url,).then(response => {
                    this.GetAllMater = [];
                    let Code = response.data.Code;
                    if(Code == 200){   // 正常请求到数据
                        this.GetAllMater = response.data.ObjList;
                    }
                }, response => {
                    console.log(" 表格添加失败");
                    console.log(response)
                })
            },
            //  编辑  工序
            handleProcessEdit(index,row){
                this.EditProcessFormVisible = true ;
                this.formProcessEdit = row ;
            },
            editProcessForm() {    //   post
                let EditProcessUrl = "http://192.168.3.238:8088/MaterielManager/UpdateProcessWork";
                let EditProcessForm = {
                    "ProcedureNum":this.formProcessEdit.ProcedureNum,
                    "WorkStationNum":this.formProcessEdit.WorkStationNum,
                    "WorkContent":this.formProcessEdit.WorkContent,     //  只能修改 工序内容
                    "ReOrder":this.formProcessEdit.ReOrder,     //  排序
                    "WorkStationImage":this.formProcessEdit.WorkStationImage,     //  图片
                    "OperationUser":1,    //  操作者工号
                };
                console.log("修改工序的 的  >>>>>>>>>>>  EditBomForm  ")
                console.log(EditProcessUrl)
                console.log(EditProcessForm)
                let that = this ;
                this.$http.post(EditProcessUrl, EditProcessForm, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                    .then(function (response) {
                        that.EditProcessFormVisible = false;
                        that.selectProcessTable();
                        console.log("修改工序成功???????????????/");
                        console.log(response);
//                        需要提示
                    })
                    .catch(function (error) {
                        console.log("错误");
                        console.log(error);
                    });
            },
            //  删除 工序     post
            handleProcessDelete(index, row) {
                this.DeleteProcessFormVisible = true ;
                this.formProcessDelete = row ;
                console.log("删除工序获得这行上的数据")
                console.log(row)
            },
            DeleteProcessForm(){
                let DeleteProcessUrl = "http://192.168.3.238:8088/MaterielManager/DeleteProcessWork";
                let deleteProcessItem = {   //  跟后端约定好的JSON格式
                    "ProcedureNum":this.formProcessDelete.ProcedureNum,
                    "WorkStationNum":this.formProcessDelete.WorkStationNum,
                    "OperationUser":1,    //  操作者工号
                };
                let that = this;  //   that  管用的
                console.log("删除工序？？？？？");
                console.log(DeleteProcessUrl);
                console.log(deleteProcessItem);
                this.$http.post(DeleteProcessUrl, deleteProcessItem, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                    .then(function (response) {
                        console.log("删除工序成功????>>>>>>>>>>>>>>>>>>>>>>>>>>");
                        console.log(response);
                        that.DeleteProcessFormVisible = false;     //  关闭窗口
                        that.selectProcessTable();
//                        需要提示
                    })
                    .catch(function (error) {
                        console.log("错误");
                        console.log(error);
                    });

            },
        },
        mounted :function () {   //  onload
            this.selectTable();
        }
    }
</script>

<style>
    * {
        padding: 0;
    }

    html,
    body {
        height: 100%;
        width: 100%;
        overflow: hidden;
        margin: 0;
    }

    #produce {
        height: 100%;
    }
    /* 表头数据居中 */
    .table_produce thead tr th {
        text-align: center;
    }
    .table_BOM thead tr th{
        text-align: center;
    }
</style>
